package service

import (
	"mychat/internal/common/logger"
	"mychat/internal/conf"
	"mychat/internal/data"
	"mychat/internal/service/chat"
	"mychat/internal/service/chathub"
	"mychat/internal/service/helloworld"
	"mychat/internal/service/user"
)

type Service struct {
	HelloWorld  helloworld.HelloWorldService
	UserService user.UserService
	ChatHub     chathub.ChatService
	ChatService chat.ChatService
}

func NewService(bs *conf.Bootstrap, lg logger.Logger, data *data.Data) *Service {

	hw := helloworld.NewHelloWorldServie(bs, lg, data)
	userSvc := user.NewUserService(bs, lg, data)
	chatSvc := chat.NewChatService(lg, data)
	chatHub := chathub.NewChatHubService(bs.Service.ChatHub, lg, data, userSvc, chatSvc)

	return &Service{
		HelloWorld:  hw,
		UserService: userSvc,
		ChatService: chatSvc,
		ChatHub:     chatHub,
	}
}
